# coding: utf-8
from pathlib import Path

from PySide6.QtCore import QLocale

PROJECT_DIR = Path(__file__).resolve().parent.parent

# 资源目录
RESOURCE_DIR = PROJECT_DIR / 'resource'
IMAGES_DIR = RESOURCE_DIR / 'images'
CSS_DIR = RESOURCE_DIR / 'css'
ICONS_DIR = IMAGES_DIR / 'icons'  # 图标目录
SINGLE_ICONS_DIR = IMAGES_DIR / 'single'  # 单一图标目录

# app 数据目录
APP_DATA_DIR = PROJECT_DIR / 'AppData'
CONFIG_DIR = APP_DATA_DIR / 'Config'
CONFIG_FILE = CONFIG_DIR / 'config.json'
DOWNLOAD_DIR = APP_DATA_DIR / 'Download'
TEMP_DIR = APP_DATA_DIR / 'Temp'
DATA_BASE_DIR = APP_DATA_DIR / 'DataBase'

HISTORY_DB_FILE = DATA_BASE_DIR / 'history.db'

# 创建目录
APP_DATA_DIR.mkdir(exist_ok=True)
CONFIG_DIR.mkdir(exist_ok=True)
DOWNLOAD_DIR.mkdir(exist_ok=True)
TEMP_DIR.mkdir(exist_ok=True)
DATA_BASE_DIR.mkdir(exist_ok=True)

# 语言
CHINESE_SIMPLIFIED = QLocale(QLocale.Language.Chinese, QLocale.Country.China)  # 简体中文
LENOVO_USER_AGENT = 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.159 Safari/537.36&PCStore'
EDGE_USER_AGENT = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/138.0.0.0 Safari/537.36 Edg/138.0.0.0'
